let fs = require('fs');
let user = { username:"admin1",password:"12345" };
let data = fs.readFileSync('./persons.json')
let arr = JSON.parse(data.toString());
let s = arr.findIndex(item=>item.username == user.username && item.password == user.password);
if(s >=0){
  console.log('登录成功');
}else{
    console.log('用户名和密码错误');
}